import request from '@/utils/request'

// 获取仓库管理列表
export function listWarehouse(query) {
  return request({
    url: '/ord/ordwarehouse/list',
    method: 'get',
    params: query
  })
}

// 获取仓库管理列表
export function getListWarehouse(query) {
  return request({
    url: '/ord/ordwarehouse/getList',
    method: 'get',
    params: query
  })
}

// 获取库存列表
export function listInventory(query) {
  return request({
    url: '/ord/ordwarehouseproduct/list',
    method: 'get',
    params: query
  })
}

// 获取出入库历史列表
export function listwhsHistory(query) {
  return request({
    url: '/ord/ordwarehouseproduct/history',
    method: 'get',
    params: query
  })
}

// 新增仓库管理
export function setWarehouse(data) {
  return request({
    url: '/ord/ordwarehouse/save',
    method: 'post',
    data
  })
}

//删除仓库管理
export function delWarehouse(ids) {
  return request({
    url: '/ord/ordwarehouse/delete/' + ids,
    method: 'post'
  })
}

//通过id获取仓库管理详情
export function getWarehouse(id) {
  return request({
    url: '/ord/ordwarehouse/get/' + id,
    method: 'get'
  })
}

// 通过仓库id和产品id查库存量
export function getInventory(query) {
  return request({
    url: '/ord/ordwarehouse/getInventory',
    method: 'get',
    params: query
  })
}

// 入库保存
export function setInbound(data) {
  return request({
    url: '/ord/ordwarehouseproduct/inbound',
    method: 'post',
    data
  })
}

// 出库保存
export function setOutbound(data) {
  return request({
    url: '/ord/ordwarehouseproduct/outbound',
    method: 'post',
    data
  })
}
